package com.mdx.controller;

import com.mdx.bean.ConsultationBean;
import com.mdx.service.IConsultationService;
import com.mdx.service.IEventService;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * 会商
 */
@RequestMapping("consultation")
public class ConsultationController {
    @Resource
    private IConsultationService consultationService;
    @Resource
    private IEventService eventService;
    //展示所有会商信息
    @RequestMapping("findAll")
    public List<ConsultationBean> findAll(){
        return consultationService.list();
    }

    // 添加会商
    @RequestMapping("add")
    public String add(int eventId, ConsultationBean consultationBean){
        consultationService.addCon(consultationBean);
        eventService.updateAdvice(eventId,consultationBean.getConsultationInfo());
        return "ok";
    }
}
